package com.buobao.reflect.demo;

import java.lang.reflect.InvocationTargetException;

public class ClassSample {
    public static void main(String[] args) {
        try {
            Class employeeClass = Class.forName("com.buobao.reflect.demo.entity.Employee");
            System.out.println("employee class load success.");
            employeeClass.getConstructor().newInstance();
//            employeeClass.newInstance();
        } catch (ClassNotFoundException e) {
            throw new RuntimeException(e);
        } catch (InvocationTargetException e) {
            throw new RuntimeException(e);
        } catch (InstantiationException e) {
            throw new RuntimeException(e);
        } catch (IllegalAccessException e) {
            throw new RuntimeException(e);
        } catch (NoSuchMethodException e) {
            throw new RuntimeException(e);
        }
    }
}
